﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

using CSF.BusinessCore.Service;
using CSF.Customers.Data;
using CSF.Security.Data;

namespace CSF.Customers.Service
{
    [ServiceContract]
    public interface ICustomerSvc : IDataIdKeyService<Customer>, IDataEntityService<Customer>, IDataConfigService<Customer>
    {
        [OperationContract]
        List<UserAccount> GetCustomerUsers(int customerId);

        [OperationContract]
        bool JoinCustomerUser(int customerId, int userId, string createBy);

        [OperationContract]
        List<Customer> GetByUser(int userId);

        [OperationContract]
        bool ApproveBatch(IEnumerable<int> customerIds, bool isApproved, string approveComment, string approveBy);

        [OperationContract]
        List<Customer> GetByApprovalStatus(ApprovalStatus status);

        [OperationContract]
        List<Customer> GetChildren(int companyId);

        [OperationContract]
        [FaultContract(typeof(ExceptionWrapper<DuplicateUserNameException>))]
        int RegisterWithUser(UserAccount userAccount, Customer customer, int applicationId);

        [OperationContract]
        bool UpdateBySelf(Customer customer, string modifyBy);

        [OperationContract]
        int InsertCustomerUser(UserAccount entity, int CustomerId, string createBy);

        [OperationContract]
        bool UpdateByIdByUser(UserAccount entity, int CustomerId, string createBy);

    }
}
